Install Acceleration Framework into Training Script - #157
Conversation
7b5e354 to
6095b09
Compare
|
from DM - It would be great if there was a way to pass a Python dataclass instead of yaml file we can create a new GPTQ-LOra config here https://github.com/foundation-model-stack/fms-hf-tuning/blob/main/tuning/config/peft_config.py#L21 Inside fms-tuning, we know for GPTQ-Lora we need to call AccelerationFramework() -> can we convert to a Python dataclass object accepted by AccelerationFramework -AccelerationFramework(qLORAcONFIG ) You know what dataclass instance it is so you can parse params from that we can implement this in steps though instead of requiring too much change to your framework- if we do step 1, we can merge code and get it working, while working on step 2 as enhancement We are discussing if we need 1 dataclass or multiple, but we can start with step 1 with dataclass only in tuning and see how it goes |
|
@Ssukriti @alex-jw-brooks I have made the requested changes:
Notes:
|
cf23771 to
96ad8bf
Compare
|
@fabianlim thank you for the redesign and the accelerationframework unit tests. Design looks good, so no major changes needed. Just few comments:
|
|
@Ssukriti thank you for reviewing!
The
Actually I think you are referring to this kind of test. We do already have one.
ok np! |
|
@Ssukriti I have added a set of extra tests These tests involve calling Therefore, I have added the following integration tests:
|
Ssukriti
left a comment
There was a problem hiding this comment.
will approve after conflicts are merged and all checks pass. Suggested minor edits to make it clear that GPTQLora needs a peft_config.LORAconfig passed. we have to make that clear in our documentation as users of tuning will not know that.
Remaining work in subsequent PRs after this PR is merged:
- we need to ensure that in CI/CD all the tests run regularly and they are not skipped. That means all dependencuies should be installed for our tests to run regularly . Purpose is to ensure with every release, all tests pass.
- Unit tests - Additional unit tests added are good, thank you. I did want to ensure model after tuning after GPTQLora is of correct format , and can be loaded and inferred correctly. We have had issues in past, when something would change and model format produced is no longer correct - we should have tests to capture that to have full confidence (will DM about this)
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Signed-off-by: Yu Chin Fabian Lim <flim@sg.ibm.com>
Description of the change
This PR installs the Acceleration Framework into the
sft_trainer.py. This is a followup to #119 which proposes to have a lightweight integration; the implementation of Acceleration Framework is kept seperate in the repo fms-acceleration under the samefoundation-model-stackorg.introduce a
AccelerationFrameworkArgumentsthat accepts an--acceleration_framework_config_fileargument to configure the framework.update
pyproject.tomlwith an optional dependency[fms-accel]that installs the fms-acceleration framework.update
README.mdto include basic usage offms-acceleration, using it to perform accelerated PEFT with a 4bit GPTQ-LoRA.ensure that the integration within
sft_trainer.pyis optional, the.get_frameworkcall below will silently disable framework iffms-acceldependency is not desired.restrict to only three integration points within
sft_trainer.pyscript:framework.model_loader: load model ifframework.requires_custom_loading == Trueframework.augmentation: load ifframework.requires_agumentation == Trueframework.get_callbacks_and_ready_for_train: get callbacks and do final prep onmodelandtrainer.acceleratorif required.Update: Picture has been changed to reflect new dataclass arguments flow
Related issue number
Related to the merged PR #119 for the ADR of Training Acceleration.
How to verify the PR
This PR can be verified in the following ways:
tests/acceleration, see Note-for-unit-tests below.Note for unit tests
For
tests/acceleration, note thattestenvwill not install.fms-acceldependencies, so some of the newly added tests wil be skipped. So to run all the new tests:Was the PR tested